package org.evolver.disser;

import javax.swing.*;
import net.miginfocom.swing.MigLayout;

public class InputPanel extends JPanel {
    private void addToPanel(DoubleParameter parm) {
        add(new JLabel(parm.getLabel()), "gap 10");
        JTextField field = new JTextField(parm.getDisplayString());
//        field.setInputVerifier(new DoubleVerifier());
        add(field, "w 75!");
        add(new JLabel(parm.getUnit()), "wrap");
    }
    
    InputPanel(InputVariables iVars) {
        MigLayout inputLayout = new MigLayout("", "[left][left][left]");
        setLayout(inputLayout);

        addToPanel(iVars.wg_a0);
        addToPanel(iVars.wg_b0);
        addToPanel(iVars.wg_alpha);
        addToPanel(iVars.wg_q);

        addToPanel(iVars.sm_b0);
        addToPanel(iVars.sm_d0);
        addToPanel(iVars.sm_alpha);

        addToPanel(iVars.lambda);
        addToPanel(iVars.t);
        addToPanel(iVars.delta_l);
        addToPanel(iVars.delta_xt);

        addToPanel(iVars.epsMin);
        addToPanel(iVars.epsMax);
    }

}
